import daisy.lang._
import Real._


object BatchReactor {

  // s1, s2, s3, s4, y1, y2: <1, 16, 14>
  def out1(s1: Real, s2: Real, s3: Real, s4: Real) = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1)
    (-0.058300) * s1 + (-0.908300) * s2 + (-0.325800) * s3 + (-0.872100) * s4
  }

  def out2(s1: Real, s2: Real, s3: Real, s4: Real) = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1)
    (2.463800) * s1 + (0.050400) * s2 + (1.709900) * s3 + (-1.165300) * s4
  }

  def state1(s1: Real, s2: Real, s3: Real, s4: Real, y1: Real, y2: Real) = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1 &&
      -1 <= y1 && y1 <= 1 && -1 <= y2 && y2 <= 1)
    (0.934292) * s1 + (0.008415) * s2 + (-0.014106) * s3 + (0.023954) * s4 + (0.077400) * y1 + (-0.010300) * y2
  }

  def state2(s1: Real, s2: Real, s3: Real, s4: Real, y1: Real, y2: Real) = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1 &&
      -1 <= y1 && y1 <= 1 && -1 <= y2 && y2 <= 1)
    (-0.006769) * s1 + (0.884924) * s2 + (-0.016066) * s3 + (-0.044019) * s4 + (-0.002200) * y1 + (0.022700) * y2
  }

  def state3(s1: Real, s2: Real, s3: Real, s4: Real, y1: Real, y2: Real) = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1 &&
      -1 <= y1 && y1 <= 1 && -1 <= y2 && y2 <= 1)
    (-0.092148) * s1 + (-0.011039) * s2 + (0.853511) * s3 + (0.107537) * s4 + (0.026700) * y1 + (0.039800) * y2
  }

  def state4(s1: Real, s2: Real, s3: Real, s4: Real, y1: Real, y2: Real) = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1 &&
      -1 <= y1 && y1 <= 1 && -1 <= y2 && y2 <= 1)
    (-0.036410) * s1 + (0.030194) * s2 + (-0.027155) * s3 + (1.004619) * s4 + (0.035600) * y1 + (0.000100) * y2
  }



}